﻿using Microsoft.AspNetCore.Mvc;

namespace TestApi.Controllers;

/// <summary>
/// 班级
/// </summary>
[ApiController,Route("api/[controller]"),ApiExplorerSettings(GroupName = "v1")]
public class ClassController : ControllerBase
{
    /// <summary>
    /// 获得List
    /// </summary>
    /// <param name="name"></param>
    /// <returns></returns>
    [HttpGet("GetList")]
    public IActionResult Get(int name)
    {
        return Ok("Get"+name);
    }
    
    /// <summary>
    /// 添加
    /// </summary>
    /// <returns></returns>
    [HttpPost]
    public IActionResult Post([FromBody]WeatherForecastController.MyStudent student)
    {
        return Ok("Post");
    }
    
    /// <summary>
    /// 添加 Res
    /// </summary>
    /// <returns>MyClass</returns>
    [HttpPost("res")]
    public WeatherForecastController.MyClass PostRes()
    {
        return new WeatherForecastController.MyClass(){ Name = "abc"};
    }
    
}